<% layout('/layouts/default.html', {title: '工作安排', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<#form:form id="inputForm" model="${taskReceiveFour}" action="${ctx}/audit/taskReceive/arrange" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="row" style="height: 70px;">
					<div class="col-xs-12" style="margin-top: 20px;">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> 选择转办人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:hidden path="id"/>
                                <#form:hidden path="decomposeTaskId"/>
                                <#form:hidden path="leaderOrgCode"/>
                              <!--  <% var items = [{label:'用户',value:'1'},{label:'部门',value:'2'}]; %>
                                <#form:radio path="receiveRadioType" items="${items}" itemLabel="label" itemValue="value" class="form-control required" defaultValue="1"/>
                                <div style="display: none" id="repeatType1">
                                   <#form:hidden path="isNewRecord"/>
                                    <#form:treeselect  title="部门选择" id="transferOrgCode1"
                                    path="transferOrgCode" labelPath="transferOrgName"
                                    url="${ctx}/sys/office/treeData?parentCode=${parentCode!}"
                                    class="form-control required" allowClear="true"/>
                                </div>
                                -->
<!--                                <div id="repeatType2">-->
                                    <#form:listselect title="用户选择"
                                    url="${ctx}/sys/empUser/customizedUserSelect" allowClear="false"
                                    labelPath="transferOrgName" id="transferOrgCode2" path="transferOrgCode" class="form-control required"
                                    checkbox="false" itemCode="userCode" itemName="userName"/>
<!--                                </div>-->
                             </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="row" style="text-align: right;">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('确 定')}</button>&nbsp;
                                <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
                            </div>
                        </div>
                    </div>
                </#form:form>
            </div>
        </div>
        <% } %>
<script>
        $("#inputForm").validate({
            submitHandler: function(form){
                js.ajaxSubmitForm($(form), function(data){
                    js.showMessage(data.message);
                    if(data.result == Global.TRUE){
                        // location.reload();
                        // $('#dataGrid').dataGrid('refresh', 1, 20);
                        js.closeCurrentTabPage(function(contentWindow){
                            contentWindow.page();
                        });
                    }
                }, "json");
            }
        });

        // $('#receiveRadioType input').on('ifCreated ifChecked', function(event){
        //     if ($(this).is(':checked')){
        //         let val = $(this).val();
        //         if (val=='1'){
        //             $("#repeatType1").hide()
        //             $("#repeatType2").show()
        //             $("#transferOrgCode2Name,#transferOrgCode2Code").val('')
        //             $("#transferOrgCode1Name").removeClass("required")
        //             $("#transferOrgCode2Name").addClass("required")
        //             $("#transferOrgCode1Name,#transferOrgCode1Code").attr("disabled",true);
        //             $("#transferOrgCode2Name,#transferOrgCode2Code").attr("disabled",false);
        //         }else if (val=='2'){
        //             $("#repeatType2").hide()
        //             $("#repeatType1").show()
        //             $("#transferOrgCode1Name,#transferOrgCode1Code").val('')
        //             $("#transferOrgCode2Name").removeClass("required")
        //             $("#transferOrgCode1Name").addClass("required")
        //             $("#transferOrgCode2Name,#transferOrgCode2Code").attr("disabled",true);
        //             $("#transferOrgCode1Name,#transferOrgCode1Code").attr("disabled",false);
        //         }
        //     }
        // });

</script>